<!DOCTYPE html>
<html>
<head>
<title>收款员信息</title>
#parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<div class="form-group col-sm-2">
				<input id="keyword" type="text" maxlength="10" class="form-control" v-model="q.shopName" @keyup.enter="query" placeholder="收款员名称只可输入中英文、数字" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')">
			</div>
			<div class="form-group col-sm-2" style="width: 210px;">
				<input id="mobilePhone" type="text" maxlength="10" class="form-control" v-model="q.mobilePhone" @keyup.enter="query" placeholder="手机号码只可输入数字" onkeyup="value=value.replace(/[^\0-9]/g,'')">
			</div>

			<select   style="float: left;height: 34px;width: 80px;border-radius:4px;margin-right: 15px;" name="status" id="status">
						<option value="">状态</option>
					  <option value="0">待激活</option>
					  <option value="1">已激活</option>
					  <option value="2">已删除</option>
				</select>
			<a class="btn btn-default" @click="query">查询</a>
			#if($shiro.hasPermission("cashiers:save"))
			<a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			#end
			<a class="btn btn-primary" @click="update"><i class="fa fa-plus"></i>&nbsp;修改</a>
			#if($shiro.hasPermission("cashiers:delete"))
			<a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			#end
			<!-- #if($shiro.hasPermission("cashiers:recovery"))
			<a class="btn btn-primary" @click="recovery"><i class="fa fa-trash-o"></i>&nbsp;恢复正常状态</a>
			#end -->
			#if($shiro.hasPermission("qrCode:list"))
			<a class="btn btn-primary" @click="codeList"><i class="fa fa-pencil-square-o"></i>&nbsp;二维码管理</a>
			#end
			<a class="btn btn-primary" @click="contrast"><i class="fa fa-trash-o"></i>&nbsp;交易比对</a>
			<!-- <a class="btn btn-primary" onclick="viewInfo()"><i class=""></i>&nbsp;查看</a> -->
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
         <div v-show="!showList" class="panel panel-default" id="edit">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
			<input id="merchantNo" type="hidden" class="form-control"  v-model="cashiers.merchantNo" placeholder="支付渠道名称"/>
			
			<div class="form-group">
			   	<div class="col-sm-2 control-label">企业名称</div>
			   	<div class="col-sm-10">
			   		<select v-model="cashiers.merchantId" class="form-control">
						  <option v-for="option in merchantOptions" v-bind:value="option.value">
						    {{ option.text }}
						  </option>
					</select>
			    </div>
			</div>
			
			<div class="form-group">
			   	<div class="col-sm-2 control-label">收款员姓名</div>
			   	<div class="col-sm-10">
			      <input type="text" id="name" class="form-control" maxlength="10"  v-model="cashiers.name" placeholder="姓名，只能输入1-10位中英文或数字" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">手机号码</div>
			   	<div class="col-sm-10">
			      <input type="text" id="mobile" class="form-control" maxlength="11" v-model="cashiers.mobilePhone" placeholder="手机号码，11位数的手机号码" onblur="ismobile()" onkeyup="value=value.replace(/[^0-9]/g,'')"/>
			    </div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label">角色</div> 
				<label class="radio-inline">
				  <input type="radio" name="status" value="1" v-model="cashiers.role"/> 管理员
				</label>
				<label class="radio-inline">
				  <input type="radio" name="status" value="2" v-model="cashiers.role"/> 收款员
				</label>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label">退款权限</div> 
				<label class="radio-inline">
				  <input type="radio" id="authority" name="authority" value="1" v-model="cashiers.authority"/> 有
				</label>
				<label class="radio-inline">
				  <input type="radio" id="noauthority" name="authority" value="2" v-model="cashiers.authority"/> 无
				</label>
			</div>
			
			<!-- <div class="form-group">
			   	<div class="col-sm-2 control-label">状态</div>
			   	<div class="col-sm-10">
			   		<select v-model="cashiers.activateState" class="form-control">
						  <option v-for="option in statusOptions" v-bind:value="option.value">
						    {{ option.text }}
						  </option>
					</select>
			    </div>
			</div> -->
			
			<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input id="submitBtn" type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定" />
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>
	
</div>
<script type="text/javascript">

	function isname() {
		var name = $("#name").val();
		if(name.length<1 || name.length >10){
		    alert("姓名输入有误，只能输入1-10位中英文和数字");
		    return false;
		}
    }

    function ismobile() {
        var mobileReg = /^1[3456789]\d{9}$/;
        var mobile = $("#mobile").val().trim();
        if (mobileReg.test(mobile) == false && mobile.length > 0) {
            alert("手机号输入有误，请重新输入");
            return false;
        }
        return true;
    }
</script>
<script src="${rc.contextPath}/js/cashiers/cashiers.js?_${date.systemTime}"></script>
</body>
</html>